﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TZReport_Model.DBModel;

namespace TZRerport_Dal.Dal
{
    public class BaseFiveTJDal : BaseTJDal
    {
        public override void SetQuertSql()
        {
            base.GetTiJianBModelSql = GetSql;
        }

        private string GetSql(string msg)
        {
            string sql = $@"SELECT {msg} tjb.TiJianLSH,tjb.TiJianH,
tjb.DengJiRQ,tjb.TiJianRQ,tjb.ChuShenRQ,tjb.ZongJianRQ,
tjb.XingMing,tjb.XingBie,
CONVERT(VARCHAR(20),tjb.NianLing) AS NianLing,tjb.YouXiaoZJ AS ShenFenZH,
tjb.HunYinZK,tjb.LianXiDH AS ShouJiH,tjb.TiJianLB,tjb.DanWeiBM
 FROM TiJianB AS tjb
LEFT JOIN TZ_Report_Record AS record
ON tjb.TiJianH=record.physical_no
WHERE tjb.ShanChuBZ=1 AND 
tjb.Statue>3 AND ISNULL(tjb.YouXiaoZJ, '')>'' AND ISNULL(tjb.LianXiDH, '')>''
AND record.physical_no IS NULL";

            return sql;
        }
    }
}
